<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>注册 - 成绩管理系统</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/login/register.css') }}">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <script src="{{ url_for('static', filename='js/login/register.js') }}"></script>
</head>
<body>
  <div class="register-container">
    <div class="register-title">
      <i class="fas fa-user-plus"></i>
      用户注册
    </div>
    <form id="register-form" action="/register_post" method="POST">
      <div class="form-group">
        <div class="input-wrapper">
          <i class="fas fa-id-card input-icon"></i>
          <input type="text" name="sno" placeholder="请输入学号" required>
        </div>
      </div>
      <div class="form-group">
        <div class="input-wrapper">
          <i class="fas fa-user input-icon"></i>
          <input type="text" name="name" placeholder="请输入姓名" required>
        </div>
      </div>
      <div class="form-group">
        <div class="input-wrapper">
          <i class="fas fa-lock input-icon"></i>
          <input type="password" name="password" placeholder="请输入密码" required>
        </div>
      </div>
      <div class="form-group">
        <div class="input-wrapper">
          <i class="fas fa-user-tag input-icon"></i>
          <select class="form-group-select" name="role">
            <option value="0">学生</option>
          </select>
        </div>
      </div>
      <div class="form-group class-select">
        <div class="input-wrapper">
          <i class="fas fa-graduation-cap input-icon"></i>
          <select class="form-group-select" name="class">
            <option value="">---请选择班级---</option>
            {% for c in classList %}
              <option value="{{ c.id }}">{{ c.class }}</option>
            {% endfor %}
          </select>
        </div>
      </div>
      <div class="btn-group">
        <button type="submit" class="btn submit-btn">
          <i class="fas fa-user-plus"></i>
          注册
        </button>
        <button type="button" class="btn back-btn" onclick="window.location.href='/admin/login'">
          <i class="fas fa-arrow-left"></i>
          返回登录
        </button>
      </div>
    </form>
  </div>
</body>
</html>